repo: Further optimize `ostree_repo_list_objects_set()`
authorColin Walters <walters@verbum.org>
Wed, 8 Jun 2022 01:41:08 +0000 (21:41 -0400)
committerColin Walters <walters@verbum.org>
Wed, 8 Jun 2022 14:18:55 +0000 (10:18 -0400)
commita71915e4367fa8757dc267d128f006661d00feda
tree3aa1f01a24e62f2d2b23becdb2bdcefac0e8c205
parentef114db341ab247c025e2e444cc008d65fbaf677
repo: Further optimize `ostree_repo_list_objects_set()`

In a prior change we discovered that for bad historical reasons
libostree was returning a mapping "object type+checksum" => "metadata"
but the "metadata" was redundant and pointless.

Optimize the prune API to use a (currently internal) object listing
API which returns a set, not a map.  This allows `GHashTable` to
avoid allocating a separate array for the values, neatly cutting
memory usage in half (from ~13MB to ~6MB) on my test case of a
dry-run prune of a FCOS build.
src/libostree/ostree-repo-private.h
src/libostree/ostree-repo-prune.c
src/libostree/ostree-repo.c